package proyecto.testcasetool.presentation.details.scenario;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;

import proyecto.testcasetool.presentation.details.DetailsPage;
import proyecto.testcasetool.presentation.editor.pages.FormLayoutFactory;



public class ScenarioDetailsPage extends DetailsPage {
	private Text txtNewText;
	private Text txtNewText_1;

	public ScenarioDetailsPage(FormToolkit toolkit, EditingDomain editingDomain,
			AdapterFactory adapterFactory) {
		super(toolkit, editingDomain, adapterFactory);
	}

	@Override
	protected void createDetailsSection(Composite parent) {

		Section s = toolkit.createSection(parent, Section.TITLE_BAR);
		s.setText("Use case details");
		s.setLayoutData(new GridData(GridData.FILL_BOTH));
		s.setLayout(FormLayoutFactory.createDetailsGridLayout(false, 1));
		
		Composite client = toolkit.createComposite(s,SWT.NONE);
		
		s.setClient(client);
		client.setLayout(new GridLayout(3, false));
		new Label(client, SWT.NONE);
		
		Label lblName = toolkit.createLabel(client, "Name:", SWT.NONE);
		lblName.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
		
		txtNewText_1 = toolkit.createText(client, "Scenario", SWT.NONE);
		
//		Label l = toolkit.createLabel(parent, "Name", SWT.WRAP);
//		GridData gd = new GridData();
//		gd.widthHint = 50;
//		l.setLayoutData(gd);
//		
//		Text text = toolkit.createText(client, "", SWT.NONE);
//		text.setEditable(true);
//		text.addModifyListener(new ModifyListener() {
//			
//			@Override
//			public void modifyText(ModifyEvent e) {
//				IItemPropertyDescriptor desc = new AdapterFactoryItemDelegator(adapterFactory).
//							getPropertyDescriptor(eObject, EssentialUseCasePackage.Literals.USE_CASE__NAME);
//				desc.setPropertyValue(eObject,
//								((Text) e.widget).getText());
//				}
//		});
//		
//		toolkit.paintBordersFor(client);
	}
	

}